<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //代码执行时间
        var timestamp1 = +new Date();
        for(var i = 0, str = ''; i < 1000 ; i++){
            str += i;
        }
        var timestamp2 = +new Date();
        console.log('代码执行时间为' + (timestamp2 - timestamp1));
    </script>
</head>
<body>
    
</body>
</html>